﻿using HlELock.Core;
using HlELock.Core.Events;
using Prism.Commands;
using Prism.Mvvm;

namespace HlELock.Modules.Hotel.Main.ViewModels
{
    internal class MenuViewModel : BindableBase
    {
        public MenuViewModel()
        {
            ClickCommand = new DelegateCommand<string>(ExecuteClickCommand);

        }
        public DelegateCommand<string> ClickCommand { get; set; }
        protected virtual void ExecuteClickCommand(string arg)
        {
            if (string.IsNullOrWhiteSpace(arg)) { return; }
            var args = arg.Split('|');
            var title = AppHelper.GetResourceString(args[1]);
            var uri = args[0];
            EventBus.Instace.GetEvent<DialogWindowEvent>().Publish(new Core.Events.DialogWindowEventArgs
            {
                Title = title,
                Uri = uri
            });
        }

    }
}
